package com.collect.cameroon.zhiAdater.zhiPhoneReview;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.collect.cameroon.MyApplication;
import com.collect.cameroon.R;
import com.collect.cameroon.zhiBean.zhiReceive.ZHIRPhoneReviewContactEntity;
import com.collect.cameroon.zhiHelper.ZHISysShareHelper;

public class ZHIPhoneReviewContactAdjuster extends BaseQuickAdapter<ZHIRPhoneReviewContactEntity, BaseViewHolder> {

    public ZHIPhoneReviewContactAdjuster() {
        super(R.layout.item_phone_review_contact_list, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, ZHIRPhoneReviewContactEntity item) {
        try {
            helper.setText(R.id.tv_name, item.getName());
            helper.setText(R.id.tv_phone, item.getMobileEncryptFormatter());
            helper.setText(R.id.tv_relationship, item.getRelationship());

            ImageView iv_call_phone = helper.getView(R.id.iv_call_phone);
            iv_call_phone.setOnClickListener(v -> ZHISysShareHelper.callPhone(MyApplication.getAppContext(), item.getMobile()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
